package com.drojian.demo2.broadcast.test1;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class AppStatueBroadcast extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
            Log.d("AppStatueBroadcast", "应用安装了，他的信息时-->"+ intent.getData());
        }else if(Intent.ACTION_PACKAGE_REMOVED.equals(action)){
            Log.d("AppStatueBroadcast", "应用卸载了，他的信息时-->"+ intent.getData());
        }
    }
}
